﻿	
CREATE proc sp_themtscd
@TenTSCD nvarchar(200),
@DVT nvarchar(100),
@ng_thuc_gs int,
@SoTK char,
@MaDV char
as
declare @dem as int
select @dem=count(*) from DanhMucTSCD where TenTSCD=@TenTSCD
if(@dem=0)
	begin
	insert into DanhMucTSCD( TenTSCD,DVT,ng_thuc_gs,SoTK,MaDV )
	values (@TenTSCD,@DVT,@ng_thuc_gs,@SoTK,@MaDV)
	select ErrCode=1
	end
else
	begin
	select ErrCode=0
	end	